﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using WL_Store.Model;

namespace WL_Store.Web.subpage
{
    public partial class BasePage : System.Web.UI.Page
    {

        protected override void OnInit(EventArgs e)
        {

            if (Session["EmployeeInfo"] == null)
            {
                //Page.ClientScript.RegisterStartupScript(this.GetType(),"alert","<script>alert('你还未登录！请先登录~~~~~'),location.href='/login.aspx'</script>");
                Response.Write("<script>alert('你还未登录！请先登录~~~~~'),location.href='../login.aspx'</script>");
                Response.End();
            }
        }

        public EmployeeInfoModel LogName { get
            {
                EmployeeInfoModel logName = Session["EmployeeInfo"] as EmployeeInfoModel;
                if (logName != null)
                {
                    return logName;
                }
                else
                {
                    return null;
                }
            } }


    }
}